package com.silence.ByteDance;

import sun.font.FontRunIterator;

import java.util.*;

public class easy__ {
    public static void main(String[] args) {
        System.out.println(solution("0.1", "1.1") == -1);
        System.out.println(solution("1.0.1", "1") == 1);
        System.out.println(solution("7.5.2.4", "7.5.3") == -1);
        System.out.println(solution("1.0", "1.0.0") == 0);
    }

    public static int solution(String version1, String version2) {
        // Edit your code here
        String[] v1str = version1.split("\\.");
        int[] v1int = new int[v1str.length];
        for (int i = 0; i < v1str.length; i++) {
            v1int[i] = Integer.parseInt(v1str[i]);
        }
        String[] v2str = version2.split("\\.");
        int[] v2int = new int[v2str.length];
        for (int i = 0; i < v2str.length; i++) {
            v2int[i] = Integer.parseInt(v2str[i]);
        }
        for (int i = 0; i < Math.max(v1int.length, v2int.length); i++) {
            int jug1 = 0, jug2 = 0;
            if (i < v1int.length) jug1 = v1int[i];
            if (i < v2int.length) jug2 = v2int[i];
            if (jug1 > jug2) return 1;
            if (jug1 < jug2) return -1;
        }
        return 0;
    }
}
